package com.primeton.wh.mcenter.api;

import com.primeton.wh.mcenter.api.fallback.ApplicationClientFallback;
import com.primeton.wh.mcenter.api.model.Application;
import com.primeton.wh.mcenter.api.response.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * Created by jinyabin on 2020/11/13.
 */

@FeignClient(name = "ccms-mcenter",configuration = FeignAutoConfiguration.class,fallback = ApplicationClientFallback.class)
public interface ApplicationClient {



    /**
     * 查询应用
     *
     * @param page    :
     * @param limit   :
     * @param appName :
     * @return : com.primeton.wh.mcenter.impl.response.Result
     * @author : YunTao.Li
     * @date : 2020/3/19 2020/3/19
     */
    @ResponseBody
    @GetMapping("/application/list")
    @ApiOperation(value = "查询应用列表")
    public Result list(@ApiParam("当前页数") long page,
                       @ApiParam("每页条数") long limit,
                       @ApiParam("消息人") String msgTo,
                       @ApiParam("应用名称") String appName) ;



    /**
     * Application新增
     *
     * @param record :
     * @return : com.primeton.wh.mcenter.impl.response.Result
     * @author : YunTao.Li
     * @date : 2020/3/19 2020/3/19
     */
    @PostMapping("/application")
    @ApiOperation(value = "新增应用")
    public Result add(@RequestBody Application record);

    /**
     * Application修改
     *
     * @param appId  :
     * @param record :
     * @return : com.primeton.wh.mcenter.impl.response.Result
     * @author : YunTao.Li
     * @date : 2020/3/19 2020/3/19
     */
    @PutMapping("/application/{appId}")
    @ApiOperation(value = "修改应用")
    public Result update(@PathVariable String appId,
                         @RequestBody Application record);

}
